package org.laobai.permission.controller;

import org.laobai.upload.service.UploadTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("upload")
public class UploadController {

    @Autowired
    private UploadTemplate uploadTemplate;

    @PostMapping("img")
    public String upload(MultipartFile file) {
        return uploadTemplate.upload(file);
    }
}
